﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace myMapObj
{

    /// <summary>
    /// 属性字段类
    /// </summary>
    public class moField
    {
        #region 字段
        private string _Name = "";//名称
        private string _AliasName = "";//别名
        private moValueTypeConstant _ValueType = moValueTypeConstant.dInt32;//类型
        private Int32 _Length; //长度，对字符型字段有用
        #endregion

        #region 构造函数
        public moField(string name)
        {
            _Name = name;
            _AliasName = name;
        }
        public moField(string name, moValueTypeConstant valueType)
        {
            _Name = name;
            _AliasName = name;
            _ValueType = valueType;
        }
        #endregion

        #region 属性

        /// <summary>
        /// 名称（只读）
        /// </summary>
        public string Name
        {
            get { return _Name; }
        }

        /// <summary>
        /// 别名
        /// </summary>
        public string AliasName
        {
            get { return _AliasName; }
            set { _AliasName = value; }
        }

        /// <summary>
        /// 值类型（只读）
        /// </summary>
        public moValueTypeConstant ValueType
        {
            get { return _ValueType; }
        }

        /// <summary>
        /// 长度（只读）
        /// </summary>
        public Int32 Length
        {
            get { return _Length; }
        }
        #endregion

        #region 方法
        //复制
        public moField Clone()
        {
            moField sField = new moField(_Name, _ValueType);
            sField._AliasName = _AliasName;
            sField._Length = _Length;
            return sField;
        }
        #endregion
    }
}
